<template>
  <h2>子组件</h2>
  <input type="text"  v-model="username" @keyup="transfer">
  <input type="text" :value="title" @input="transfer2">
  <!--  -->
  <p>子组件中的输入{{username}}</p>
</template>

<script lang="ts">
import { Vue, Options, Prop, Emit } from 'vue-property-decorator';
@Options({ components: {

},
inheritAttrs: false,
})
export default class Footter extends Vue {
  @Prop() public title!: string;
  public username = 'libai';


  @Emit('up')
  transfer() {
    return this.username;
  }
  @Emit('updateTitle')
  transfer2(e: InputEvent) {
    return e.data;
  }
  // transfer2(e: InputEvent) {
  //   console.log(e);
  // }
  public created() {
    console.log('$attrs', this.$attrs);
  }
}
</script>

<style lang="postcss">

</style>
